<template>
  <div>
    <!--svg-icon icon-class="github" 引入assets.icons.svg.github.svg -->
    <svg-icon icon-class="qq" @click="showqq" />
    <el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
      <span>{{qq}}</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { getQQ } from '@/api/wu/qq'
export default {
  name: 'WuQq',
  data() {
    return {
      qq: '',
      // 是否显示弹出层
      dialogVisible: false,
    }
  },
  methods: {
    showqq() {
      //新建一个窗口，显示qq,用elementUI dailog对话框组件
      this.dialogVisible = true
      //response 是getQQ获取返回值的方法
      getQQ().then(response => {
        this.qq = response.msg
      })
    },
    handleClose(done) {
      this.$confirm('确认关闭？')
        .then(_ => {
          done();
        })
        .catch(_ => { });
    }
  }
}
</script>